﻿using EasyDDD.AdminModule.Domain.AggregateSysMenu;
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations.Schema;

namespace EasyDDD.AdminModule.Domain.AggregateSysAdminRole
{

    [PrimaryKey(nameof(RoleId), nameof(SysMenuId))]
    public class SysAdminRoleMenu
    {
        protected SysAdminRoleMenu() { }

        public virtual SysAdminRole SysAdminRole { get; private set; } = default!;

        [ForeignKey(nameof(SysAdminRole))]
        public Guid RoleId { get; private set; } = default!;

        //public virtual SysMenu SysMenu { get; private set; } = default!;

        [ForeignKey(nameof(SysMenu))]
        public Guid SysMenuId { get; private set; } = default!;

        public SysAdminRoleMenu(Guid roleId, Guid sysMenuId)
        {
            RoleId = roleId;
            SysMenuId = sysMenuId;
        }
    }
}

